<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    html{
        height: 100%;
    }
    body{
        height: 100%
    }
    .e1{
        width: 1000px;
        height: 100%;
        background-color: rgb(217, 255, 3);
        text-align: center;
        box-sizing: border-box;
        margin: auto;
    }    
    </style>
</head>
<body>
    <div class="e1">在浏览器视窗中居中</div>
</body>
</html>